import vue from '@vitejs/plugin-vue'
import path from "path";
import { defineConfig } from "vite";

const page = process.env.npm_config_page
const resolvePath = (relativePath) => path.resolve(__dirname, relativePath)
export default defineConfig({
    root: page ? resolvePath(`./page/${page}`) : process.cwd(),
    publicDir: resolvePath('./public'),
    resolve: {
        alias: {
            "@": resolvePath('./src'),
        }
    },
    plugins: [
        vue(),
    ],
    build: {
        rollupOptions: {
            input: [
                resolvePath('./page/aaa/index.html'),
                resolvePath('./page/bbb/index.html')
            ]
        }
    }
})  